﻿using LearnTower.Business.Contract;
using LearnTower.Business.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Text;
using System.Threading.Tasks;

namespace LearnTower.Business.Concrete
{
    [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession)]
    public class AuthenticationService : IAuthenticationService, IDisposable
    {
        public AuthenticationService()
        {
            Console.WriteLine("AuthenticationService Constructor");
        }

        Response IAuthenticationService.Authenticate(string userName, string password)
        {
            Console.WriteLine("SessionID:{0}", OperationContext.Current.SessionId);
            return new Response() { ExtenseObject = new User() { UserName = userName, Password = password } };
        }

        public void Dispose()
        {
            Console.WriteLine("AuthenticationService Dispose");
        }
    }
}
